package com.bit.ioc.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/prop")
public class PropertiesController {

    @Value("${my.key}")
    private String myKey;

    @Value("${my.key1}")
    private Integer myKey1;

    @Value("${my.key2}")
    private boolean myKey2;

    @Value("${spring.datasource.url}")
    private String url;

    @RequestMapping("/readValue")
    public String readValue(){
        System.out.println("mykey:"+ myKey);
        System.out.println("mykey1:"+ myKey1);
        System.out.println("mykey2:"+ myKey2);
        System.out.println("url:"+url);
        return "mykey:"+ myKey;
    }
}
